<template>
	<action-bar type="home" @onSetUP="onSetUP"></action-bar>
	<view @click="cancel_info=false" class="">
		<view>
			<image class="height100vh image posiab top0" src="/static/img/changko.png"></image>
			<view class="flex-ju-c height100vh posire zindex5">
				<view class=" height100vh ">
					<view class="width100vw">
						<view class="flex-ju-c hkmk">
							<view class="amt200">
								<view class="flex-ju-b color333 height90">
									<view class="">
										<view class="width100vw flex-ju-c ">
											<view class="flex-a-i mr1600 posire">
												<image @click.stop="showinfo" v-if="user.avatar"
													class="image mr15 ra110 wh110-110" :src="IMGURL+user.avatar">
												</image>
												<image v-else @click.stop="showinfo" mode="widthFix"
													class="image mr15 width110" src="/static/img/xaing.png">
												</image>
												<view @click.stop="showinfo">{{user.nickName}}</view>

												<view class="posiab top140 zindex5 hidden "
													:class="cancel_info?'sanimation':'animation'">
													<view class="bgf6faff pg30 ">
														<view class="width600 ">
															<view class="flex-a-i ">
																<view class=" posire">
																	<image @click.stop="setimgtou" mode="widthFix"
																		class="image posiab bottom0 right20 width40"
																		src="/static/img/setimg.png"></image>
																	<image v-if="user.avatar"
																		class="image mr15  ra110 wh110-110"
																		:src="IMGURL+user.avatar"></image>

																	<image v-else @click.stop="showinfo" mode="widthFix"
																		class="image mr15 width110"
																		src="/static/img/xaing.png">
																	</image>

																</view>
																<view>
																	<view @click.stop="tapinfo" class="flex-a-i size36">
																		{{user.nickName}}
																		<image mode="widthFix"
																			class="image ml15 width36"
																			src="/static/img/bianju.png"></image>
																	</view>
																	<view class="flex-a-i size28 color666">
																		我的云会议室：{{priv_room_cuid}}
																		<image @click.stop="copy(priv_room_cuid)"
																			mode="widthFix" class="image ml15 width36"
																			src="/static/img/copy.png"></image>
																	</view>
																</view>
															</view>
														</view>
														<view class="color666 size28">
															<view class="mt20 mb20">登录名：{{user.userName}}</view>
															<view>所属组织：{{user.deptName}}</view>
														</view>
														<view class="bgfff pg30 ra10 size32 mt30 flex-ju-b hover">
															<view class="flex-a-i">
																<image mode="widthFix" class="image mr15 width50"
																	src="/static/img/bendiziyuan.png"></image>
																本地资源
															</view>
															<image mode="widthFix" class="image  width50"
																src="/static/img/zright.png">
															</image>
														</view>
														<view @click="tapposs"
															class="bgfff hover pg30 ra10 size32 mt15 flex-ju-b">
															<view class="flex-a-i">
																<image mode="widthFix" class="image mr15 width50"
																	src="/static/img/mima.png"></image>
																修改密码
															</view>
															<image mode="widthFix" class="image  width50"
																src="/static/img/zright.png">
															</image>
														</view>
														<view @click="tapout"
															class="bgfff hover pg30 ra10 size32 mt15 flex-ju-b">
															<view class="flex-a-i">
																<image mode="widthFix" class="image mr15 width50"
																	src="/static/img/tuichu.png"></image>
																退出登录
															</view>
														</view>
													</view>
												</view>
											</view>
										</view>
									</view>

									<view class="wh300-90 bge8efff flex-ju-c posiab right0"
										style="border-bottom-left-radius:20px;border-top-left-radius:20px;">
										<view @click="$refs.upDrawer.open()" class="color000 flex-a-i ">
											待参加的会议
											<image mode="widthFix" class="image width45" src="/static/img/rights.png">
											</image>
										</view>
									</view>
								</view>
								
								
								<meeting-drawer ref="upDrawer"></meeting-drawer>

								<el-drawer v-if="0" modal-class="viewdrawer" @open="drawer_open" z-index="10" v-model="drawer"
									title="I am the title" :with-header="false" size="50%" :before-close="handleClose">
									<view>
										<view class="flex-ju-b">
											<view class="size36 color333 bold flex-a-i  ">
												<view class="wh6-30 mt8 bg2C7BFF mr15"></view>待参加会议
											</view>

											<view class="flex-a-i">
												<view class="seathview posire flex-a-i mr20">

													<el-input clearable @change="mettingChang" v-model="mettingSou"
														:suffix-icon="Search" class="width500"
														placeholder="请输入会议主题/发起人搜索"></el-input>

													<!-- <image mode="heightFix" class="image posiab right60 height40"
														src="/static/img/suosuo.png">
													</image>
													<image mode="heightFix" class="image posiab right100 height32"
														src="/static/img/guanbi.png">
													</image> -->

												</view>
												<view @click="tapHistory" class="flex-a-i color2569ff">历史会议
													<image mode="heightFix" class="image height48"
														src="/static/img/lright.png">
													</image>
												</view>
											</view>
										</view>

										<view v-if="isdata" class="flex-ju-c flex-col size28 color666">
											<image mode="heightFix" class="image height320"
												src="/static/img/nohuiyi.png">
											</image>
											暂无会议
										</view>

										<view v-for="(item,k) in meetinglist" :key="k"
											class="bgf4f8f9 pg30 ra20 mt30 flex-ju-b">
											<view class="">
												<view class="flex-a-i mb20">
													<view class="color165FFF bgE6EFFA wh104-40 nowrap flex-ju-c size24">

														<text v-if="istime(item.start_dtm)">未开始</text>
														<text class="colorF2A521" v-else>进行中</text>

													</view>
													<view class="size32 ml20 one ">{{item.mr_name}}
														<!-- <view v-if="item.launcher_usr_id>1"
															style="background: rgba(22,95,255,0.10);"
															class="wh40-40 ra40 color165FFF size24 flex-ju-c">
															我
														</view> -->
													</view>
												</view>
												<view class="flex-a-i color666">
													<image mode="heightFix" class="image mr10 height40"
														src="/static/img/yonghu.png">
													</image>
													{{item.launcher_usr_nick_name?item.launcher_usr_nick_name:item.launcher_usr_name}}
													<template v-if="item.weekly_period==1111111">
														<image mode="heightFix" class="image ml50 mr10 height40"
															src="/static/img/zhouqi.png">
														</image>
														永久
													</template>
													<template v-else>
														<image mode="heightFix" class="image ml50 mr10 height40"
															src="/static/img/zhouqi.png">
														</image>
														{{item.weekly_period>0?'周期':'单次'}}
													</template>


													<view class="wh2-40 bgB4B9BF ml50"></view>
													<image mode="heightFix" class="image ml50 mr10 height40"
														src="/static/img/time.png">
													</image>
													{{item.start_dtm?timeTamp(item.start_dtm):timeTamp(item.create_dtm)}}
												</view>
											</view>

											<view class="flex-a-i">
												<el-button @click="callNow(item)" v-if="!istime(item.start_dtm)"
													class="bg165FFF" type="primary">加入3</el-button>

												<el-popover placement="bottom" trigger="hover">
													<template #reference>
														<image @mouseenter="hoverImg(item,k)" mode="heightFix"
															class="image ml50 mr10 height62"
															src="/static/img/sandian.png"></image>
													</template>

													<el-table @cell-click="cellclick($event,k)" class="no-border-table"
														:show-header="false" :data="gridData">
														<el-table-column property="date" label="date" />
													</el-table>

												</el-popover>
											</view>

										</view>

									</view>

									<el-drawer @open="drawerOpen" z-index="15" size="55%" modal-class="viewdrawer"
										v-model="innerDrawer" :with-header="false" title="I'm inner Drawer"
										:append-to-body="true" :before-close="handleClose">
										<view class="flex-ju-b">
											<view @click="innerDrawer=false" class="size36 color333 bold flex-a-i  ">
												<image mode="heightFix" class="image height48"
													src="/static/img/leftt.png">
												</image>
												历史会议1
											</view>
											<view class="flex-a-i">
												<view class="seathview posire flex-a-i ">
													<el-input class="width500" placeholder="请输入会议主题/发起人搜索"></el-input>

													<image mode="heightFix" class="image posiab right60 height40"
														src="/static/img/suosuo.png">
													</image>
													<image mode="heightFix" class="image posiab right160 height32"
														src="/static/img/guanbi.png">
													</image>

												</view>
												<view @click="showlost" class="flex-a-i color2569ff">管理</view>
											</view>
										</view>

										<scroll-view scroll-y class="height1400 width1000 scroll-view">
											<el-checkbox-group v-model="checkedCities"
												@change="handleCheckedCitiesChange">

												<el-checkbox :class="check_box_detail?'':'wCheckcls'"
													class="height250 wCheck width1000" v-for="(item,y) in histories"
													:value="item.history_id" :key="y">
													<view @mouseenter="handleMouseEnter(y)">
														<view class="flex-a-i mt30">
															<!-- <el-checkbox v-model="checked1" /> -->
															<!-- <view class="flex-ju-b width1000 size28 ml20 color666">
										 			<view>12月15日 星期四</view>
										 			<view>2024年</view>
										 		</view> -->
														</view>
														<view class="flex-a-i bgf4f8f9 width1000 ">
															<!-- <el-checkbox v-model="checked1" /> -->
															<view class=" pg30 ra20 mt10  ml20 flex-ju-b width1000">
																<view class="">
																	<view class="flex-a-i mb20">
																		<view class="">
																			<image mode="heightFix"
																				class="image mr10 height40"
																				src="/static/img/huchu.png">
																			</image>

																		</view>
																		<view class="size32 ml20 one">{{item.mr_name}}
																			<view v-if="item.mr_id == priv_room_cuid"
																				style="background: rgba(22,95,255,0.10);"
																				class="wh40-40 ra40 color165FFF size24 flex-ju-c">
																				我
																			</view>
																		</view>
																	</view>
																	<view class="flex-a-i color666">
																		<image mode="heightFix"
																			class="image mr10 height40"
																			src="/static/img/yonghu.png">
																		</image>
																		<view class="one ">
																			{{item.launcher_usr_name}}
																		</view>

																		<image mode="heightFix"
																			class="image ml50 mr10 height40"
																			src="/static/img/zhouqi.png">
																		</image>
																		单次
																		<view class="wh2-40 bgB4B9BF ml50"></view>
																		<image mode="heightFix"
																			class="image ml50 mr10 height40"
																			src="/static/img/time.png">
																		</image>
																		{{timeTamp(item.end_dtm)}}
																		<view class="ml50">
																			会议号：{{item.mr_id}}
																		</view>
																	</view>
																</view>
																<view class="posiab right20" v-if="y==boxindex">
																	<el-button @click="showHistory(item,y)"
																		class="bg165FFF" type="primary">详情</el-button>
																	<el-button @click="$refs.pingjia.open()"
																		class="border165FFF">评价</el-button>
																</view>
															</view>
														</view>
													</view>
												</el-checkbox>


											</el-checkbox-group>


										</scroll-view>

										<view v-if="check_box_detail" class="posifi bottom30 " style="width:53%;">
											<view class="flex-ju-b width1000 ">
												<view class="flex-a-i size28 color666">
													<el-checkbox class="mr15" v-model="checkAll"
														:indeterminate="isIndeterminate"
														@change="handleCheckAllChange" />全选
												</view>
												<view class="flex-a-i ">
													<view @click="$refs.kk.close()"
														class="wh152-64 borderd0d6dc flex-ju-c ra5">取消</view>
													<view class="wh152-64 bgfc474c colorfff flex-ju-c ml60 ra5">删除
													</view>
												</view>
											</view>
										</view>
									</el-drawer>

								</el-drawer>


								<view class="flex-ju-c size32 flex-col ">
									<view class="flex-a-i mt130 mb170">
										<view @click="tapTO(newItem[0])" v-if="newItem[0]"
											class="colorfff flex-ju-c posire zindex0">
											<image mode="heightFix" class="image height456 width460"
												:src="IMGURL+newItem[0].bigFilePath">
											</image>
											<view class="posiab mt160">{{newItem[0].name}}</view>
										</view>
										<view v-if="newItem[1]" @click="tapTO(newItem[1])"
											class="colorfff flex-ju-c posire mr33 ml33 zindex0 ">
											<image mode="heightFix" class="image height456 width460"
												:src="IMGURL+newItem[1].bigFilePath">
											</image>
											<view class="posiab mt160">{{newItem[1].name}}</view>
										</view>


										<view class="flex-ju-b  flex-wrap height456 width930">
											<template v-for="(item,f) in newItem" :key="f">
												<view @click="tapTO(item)" v-if="f>1&&f<6" class="wh448-212">
													<view class="bgfff flex-ju-c wh448-212 ra40 mr33">
														<image mode="heightFix" class="image mr25 height144"
															:src="IMGURL+item.filePath"></image>
														{{item.name}}
													</view>
												</view>
											</template>

										</view>
									</view>
								</view>

								<view class="width1000 color303133 size32 flex-ju-c">

									<template v-for="(item,p) in newItem" :key="p">

										<view @click="tapTO(item)" v-if="p>5&&p<10"
											class="bgfff flex-ju-c ml30 mr30 wh208-212 flex-col ra40">
											<image mode="heightFix" class="image  mb10 height104"
												:src="IMGURL+item.filePath">
											</image>
											<view>{{item.name}}</view>
										</view>

									</template>

								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 修改姓名 -->
		<set-name ref="showmode" :user="user" @sctrue="infoSctrue"></set-name>

		<!-- 修改密码 -->
		<set-pwd ref="showsetpoww" @sctrue="sctrue"></set-pwd>


		<tishi @queding="clodeyue" isexit="1" ref="huiyi" :isclen="1" bgcolor="#165fff" title="您确定要取消该预约会议吗？"></tishi>

		<!-- <tishi ref="showtishi" :isclen="0" bgcolor="#165fff" title="长时间未操作，已自动退出登录！"></tishi> -->

		<!-- 设置 -->
		<configuration @newItem="tapnewItem" @TAPiscam="TAPiscam" ref="onSetUP" @change="upclose"></configuration>
		<!-- 手机下载配置 -->
		<phone-config ref="upPhone"></phone-config>
		<!-- 我的评价 -->
		<my-evaluate ref="pingjia"></my-evaluate>

		<!-- 会议详情 -->
		<meeting-detail :meetinginfo="meetinginfo" ref="upMeetingDetail"></meeting-detail>

		<!-- 加入会议 -->
		<push-meeting @pushMeeting="pushMeeting" ref="upaddhuiyi"></push-meeting>

		<!-- 发起会议 -->
		<initiate-meeting @setup="setup" :priv_room_cuid="priv_room_cuid" @startMeeting="startMeeting"
			ref="upfahuiyi"></initiate-meeting>

		<!-- 输入参会密码 -->
		<join-pwd ref="joinPWD" @joinPWD="tapJoinPWD" @confirm="tapJoin"></join-pwd>

		<!-- 会议设置 -->
		<meeting-setup @setName="setName" ref="huiyishez"></meeting-setup>

		<call-end :meeting_call_width="meeting_call_width" :textname="calldata.conference_name" @rejectJoin="rejectJoin"
			@incomingCall="incomingCall"></call-end>

		<tishi ref="upLogin" isclen="1" bgcolor="#fc474c" title="您确定要退出登录吗？"></tishi>
	</view>
</template>

<script>
	import {
		ElMessage
	} from 'element-plus'
	import {
		Search
	} from '@element-plus/icons-vue'
	import {
		lkrequest
	} from '../../js/lk/request.js'
	export default {
		data() {
			return {
				ismic: true,
				iscam: true,
				nickName: "",
				userName: "",
				timeout: "",
				schedule_index: "",
				calldata: {},
				mettingSou: "",
				meetinginfo: {},
				isdata: false,
				Search,
				priv_room_cuid: "",
				join_pwd: "",
				ctrl_pwd: "",
				user: "",
				password: "1234",
				username: "dqyptyg2",
				drawer: false,
				time_id: "",
				taht_room_cuid: "",
				meetinglist: [],
				meetinglists: [],
				priv_room_id: "",
				newjoin_pwd: "",
				histories: [],
				checkedCities: [],
				checkAll: false,
				isIndeterminate: true,
				check_box_detail: false,
				boxindex: -1,
				schedule_id: "",
				meetingService: {},
				meeting_call_width: "0",
				newItem: [],
				innerDrawer: false,
				gridData: [{
						type: "1",
						date: '编辑',
					},
					{
						type: "2",
						date: '详情',
					},
					{
						type: "3",
						date: '取消预约',
					},
				],
				cancel_info: false
			}
		},
		onShow() {

		},
		onLoad() {
			if (uni.getStorageSync('info')) {
				let infos = uni.getStorageSync('info')
				this.priv_room_cuid = infos.priv_room_cuid
				this.priv_room_id = infos.priv_room_id
				console.log(this.priv_room_cuid, "hhhh", infos)
			}

			this.http('/app/meetingService/info').then(res => {
				this.meetingService = res.data
				uni.setStorageSync('meetingService', res.data)
			})

			this.http('/getAppInfo').then(res => {
				if (!uni.getStorageSync('user')) {
					this.logininfo(res)
				}
				uni.setStorageSync('user', res.data)
				this.user = res.data.user
			})

		},
		mounted() {
			if (!uni.getStorageSync('token')) {
				uni.reLaunch({
					url: "/pages/index/login"
				})
			}

			uni.$off('joinpwd')
			uni.$on('joinpwd', res => {
				this.$refs.joinPWD.open()
			})

			uni.$off('callSucceed')
			uni.$on('callSucceed', res => {
				uni.hideLoading()
				uni.navigateTo({
					url: './video'
				})
			})

			zjsdk3.on_dev_test_device_failed = (is_camera, device_id, reason) => {
				console.log(is_camera, device_id)
				console.log(reason, "kkk")
				uni.showToast({
					title: "未检测到，请检查",
					icon: "none"
				})
			}

			uni.$off('CBcalldata')
			uni.$on('CBcalldata', res => {
				this.meeting_call_width = '1000'
				this.calldata = res
				clearTimeout(this.timeout)
				this.timeout = setTimeout(() => {
					this.rejectJoin()
				}, 20000)
			})
		},
		methods: {
			onSetUP() {
				this.$refs.onSetUP.open()
			},
			tapJoinPWD() {
				this.newjoin_pwd = ''
			},
			tapHistory() {
				uni.showToast({
					title: "开发中",
					icon: "none"
				})
				return
				innerDrawer = true
			},
			TAPiscam(e) {
				this.iscam = e
			},
			tapnewItem(itewm) {
				this.newItem = itewm
			},
			tapJoin(pwd) {
				this.newjoin_pwd = pwd
				uni.showLoading()
				this.call_now()
			},
			call_now() {
				uni.showLoading()
				console.log(this.newjoin_pwd, "mmmm")
				zjsdk3.make_call_now(this.meetingService.meetingIp, this.meetingService.port, (this.taht_room_cuid ? this
					.taht_room_cuid : this
					.priv_room_cuid), this.newjoin_pwd, this.user.deptName)
			},
			pushMeeting(room_cuid, ismic, iscam) {
				this.taht_room_cuid = room_cuid
				this.ismic = ismic
				this.iscam = iscam
				this.call_now()
			},
			tapTO(item) {
				if (item.code == "realTimeMonitor") {
					uni.navigateTo({
						url: "/pages/jiankong/index"
					})
				} else if (item.code == "reservationMeeting") {
					uni.navigateTo({
						url: './meeting?room_id=' + this.priv_room_id
					})
				} else if (item.code == "videoCall") {
					uni.navigateTo({
						url: "/pages/callvideo/index"
					})
				} else if (item.code == "initiateMeeting") {
					this.taht_room_cuid = ''
					this.$refs.upfahuiyi.open()
				} else if (item.code == "joinMeeting") {
					this.taht_room_cuid = ''
					this.$refs.upaddhuiyi.open()
				} else if (item.code == "wheelPatrolPlan") {
					uni.navigateTo({
						url: "/pages/jiankong/patrol"
					})
				} else if (item.code == 'voiceBroadcast') {
					uni.navigateTo({
						url: "/pages/jiankong/broadcast"
					})
				} else {
					uni.showToast({
						title: "开发中",
						icon: "none"
					})
				}
			},

			hoverImg(item, index) {
				var data = [{
					type: "2",
					date: '详情',
				}]
				if (item.start_dtm) {
					if (this.istime(item.start_dtm)) {
						this.gridData = [{
								type: "1",
								date: '编辑',
							},
							{
								type: "2",
								date: '详情',
							},
							{
								type: "3",
								date: '取消预约',
							},
						]
					} else {
						this.gridData = data
					}
				} else {
					if (this.istime(item.start_dtm)) {
						this.gridData = [{
								type: "1",
								date: '编辑',
							},
							{
								type: "2",
								date: '详情',
							},
							{
								type: "3",
								date: '取消预约',
							},
						]
					} else {
						this.gridData = data
					}
				}
			},
			infoSctrue(name) {
				uni.showLoading()
				this.http('/system/user/edit', {
					nickName: name,
					userId: this.user.userId
				}, 'post').then(res => {
					uni.showToast({
						title: "修改成功",
						icon: "none"
					})
					this.user.nickName = name
					this.$refs.showmode.close()
					uni.hideLoading()
				})
			},

			callNow(item) {
				window.Invalidpin = 0
				let room_cuid = item.mr_id ? item.mr_id : item.cuid
				this.call_now(room_cuid)
			},
			//预约搜索
			mettingChang() {
				let arr = []
				if (this.mettingSou) {
					this.meetinglists.map(item => {
						if (item.mr_name.indexOf(this.mettingSou) != -1 || item.launcher_usr_nick_name
							.indexOf(this
								.mettingSou) != -1) {
							arr.push(item)
						}
					})
					this.meetinglist = arr
				} else {
					this.meetinglist = this.meetinglists
				}

				if (this.meetinglist.length) {
					this.isdata = false
				} else {
					this.isdata = true
				}

			},
			//取消预约
			clodeyue() {
				loginMgr.del_schedule(this.schedule_id).then(res => {
					if (res.result == 0) {
						this.meetinglist.splice(this.schedule_index, 1)
						this.$refs.huiyi.close()
						if (this.meetinglist.length) {
							this.isdata = false
						} else {
							this.isdata = true
						}
						uni.showToast({
							title: "取消成功",
							icon: "none"
						})
						console.log(res)
					} else {
						ElMessage({
							message: res.reason,
							type: 'warning',
						})
					}
				})
			},

			//回显会议设置
			setup() {
				this.$refs.huiyishez.open()
			},

			get_room_info() {
				uni.showLoading()
				return new Promise((resolve, reject) => {
					loginMgr.get_self_room_info().then(res => {
						resolve(res)
					})
				})
			},
			//预约详情
			showHistory(item) {
				this.$refs.upMeetingDetail.open()
			},
			handleMouseEnter(e) {
				this.boxindex = e
			},
			drawerOpen() {
				console.log(this.histories)
				this.ghttp('/mr/histories/history_ids/search/', {
					cmdid: "search_histories"
				}, 'post').then(res => {
					this.ghttp('/mr/histories/history_ids/', {
						cmdid: "query_histories",
						history_ids: res.history_ids
					}, 'post').then(res => {

						let arr = []
						res.history_ids.map((item, index) => {
							arr.push({
								history_id: item,
								duration: res.durations[index],
								end_dtm: res.end_dtms[index],
								extra: res.extras[index],
								launch_dtm: res.launch_dtms[index],
								launcher_usr_id: res.launcher_usr_ids[index],
								launcher_usr_name: res.launcher_usr_names[index],
								live_pwd: res.live_pwds[index],
								mr_id: res.mr_ids[index],
								mr_name: res.mr_names[index],
								participantse: res.participantses[index]
							})
						})
						this.histories = arr
						console.log(arr, "gggg")
					})
				})
			},

			// 云会议室设置
			setName(room_name, join_pwd, ctrl_pwd) {

				uni.showLoading()
				loginMgr.mod_self_room_info({
					room_name: room_name,
					join_pwd: join_pwd,
					ctrl_pwd: ctrl_pwd
				}).then(res => {
					console.log(res, "ggg")
					uni.hideLoading()
					if (res.result == 0) {
						ElMessage({
							message: '设置成功',
							type: 'warning',
						})
						uni.showToast({
							title: "设置成功",
							icon: "none"
						})
						this.$refs.huiyishez.close()
					} else {
						ElMessage({
							message: res.reason,
							type: 'warning',
						})
					}
				})

			},



			drawer_open() {
				this.taht_room_cuid = ''
				const date = new Date();
				const year = date.getFullYear();
				const month = date.getMonth() + 1;
				const day = date.getDate();
				var time = year + '/' + month + '/' + day + ' 00:00'
				var thistime = new Date(time).getTime() / 1000
				var endtiem = thistime + 604800
				this.meetinglist = []
				this.meetinglists = []
				uni.showLoading()
				loginMgr.get_all_meeting().then(res => {
					for (var key in res) {
						this.meetinglist.push(res[key])
						this.meetinglists.push(res[key])
					}
					loginMgr.get_schedules(thistime, endtiem).then((ress, m) => {
						console.log(ress, "ppp")
						uni.hideLoading()
						if (ress.length) {
							this.meetinglist.push(ress[0])
							this.meetinglists.push(ress[0])
						}
						if (this.meetinglist.length) {
							this.isdata = false
						} else {
							this.isdata = true
						}
					})

				})
			},

			startMeeting(ismic, iscam) { //进入会议
				this.ismic = ismic
				this.iscam = iscam
				uni.showLoading()
				this.get_room_info().then(res => {
					loginMgr.select_usr_join_mr(res.cuid).then(ress => {

						if (ress.result == 0) {
							zjsdk3.make_call_now(this.meetingService.meetingIp, this.meetingService
								.port, res.cuid, res.ctrl_pwd, this.user.deptName)
						} else {
							if (ress.code == 7094) {
								uni.hideLoading()
								ElMessage({
									message: '当前会议室正在使用，请更换会议室',
									type: 'warning',
								})
								return
							} else {
								ElMessage({
									message: ress.reason,
									type: 'warning',
								})
								return
							}
						}

					})
				})


			},

			setimgtou() {

				uni.chooseImage({
					count: 1,
					sizeType: ['original', 'compressed'],
					sourceType: ['album'],
					success: (res) => {
						uni.uploadFile({
							header: {
								'APP': '5415',
								'Authorization': 'Bearer ' + (uni.getStorageSync("token") ? uni
									.getStorageSync("token") : '')
							},
							url: this.geturl('') + '/system/user/profile/avatar',
							filePath: res.tempFilePaths[0],
							name: 'avatarfile',
							formData: {
								'avatarfile': res.tempFilePaths[0]
							},
							success: (uploadFileRes) => {
								this.user.avatar = JSON.parse(uploadFileRes.data).imgUrl
								uni.showToast({
									title: "更新成功",
									icon: "none"
								})
							}
						});

					}
				})
			},
			sctrue(pwass, newpwass, dnewpwass) { //修改密码
				this.http('/system/user/password/update', {
					userId: this.user.userId,
					oldPassword: pwass,
					password: newpwass,
				}, 'post').then(res => {
					uni.showToast({
						title: "修改成功",
						icon: "none"
					})
					setTimeout(() => {
						uni.setStorageSync('token', '')
						uni.reLaunch({
							url: "/pages/index/index"
						})
					}, 700)
				})
			},


			//拒绝来电
			rejectJoin() {
				this.meeting_call_width = '0'
				clearTimeout(this.timeout)
				loginMgr.reject_join_mr()
			},
			//接听来电
			incomingCall() {
				uni.showLoading()
				zjsdk3.incoming_call(this.meetingService.meetingIp, '443', this.calldata.conference_alias, this
					.calldata.secret_key, this.calldata.time, uni.getStorageSync('sdkinfo').account, this
					.calldata.token)
			},

			logininfo(res) {
				window.loginMgr = new LoginMgr(res.data.meetingIp, res.data.port, {
					dev_id: res.data.devid,
					dev_token: res.data.devToken
				})
				loginMgr.on_receive_invite = (data) => {
					this.meeting_call_width = '1000'
					this.calldata = data
					console.log(data, "5555555")
					clearTimeout(this.timeout)
					this.timeout = setTimeout(() => {
						this.rejectJoin()
					}, 20000)
					uni.$emit('CALL', data)
				}
				loginMgr.on_login_failed = (data) => {
					uni.hideLoading()
					if (data.code == 5005) {
						uni.setStorageSync("token", '')
						uni.setStorageSync("user", '')
						uni.setStorageSync("info", '')
						uni.reLaunch({
							url: "/pages/index/login"
						})
					}
				}

				let sre = res.data.meetingUserName.split("@")

				loginMgr.login(sre[0], sre[1], res.data.meetingUserPwd).then(res => {
					console.log(res, "iii")
					if (res.result == 0) {
						uni.setStorageSync('sdkinfo', res.data.results)
						loginMgr.init()
						loginMgr.get_self_info().then(res => {
							console.log(res, "ggggg")
							this.priv_room_cuid = res.priv_room_cuid
							this.priv_room_id = res.priv_room_id
							uni.setStorageSync('info', res)
							loginMgr.put_self_status('1')
						})

					}
				})

				clearInterval(this.time_id)
				this.time_id = setInterval(() => {
					lkrequest(
						`/user/refresh-token?token=${uni.getStorageSync('user').monitorToken}`, {},
						'post',
						'refresh-token')
				}, 1740000)
			},

			//预约管理
			showlost() {
				this.check_box_detail = true
			},
			handleCheckedCitiesChange(value) {
				console.log(value, "mmm")
				const checkedCount = value.length
				this.checkAll = checkedCount === this.histories.length
				this.isIndeterminate = checkedCount > 0 && checkedCount < this.histories.length
			},
			handleCheckAllChange(val) {
				console.log(val, "ddd")
				var arr = []
				this.histories.map(item => {
					arr.push(item.history_id)
				})

				this.checkedCities = val ? arr : [],
					this.isIndeterminate = false
			},

			cellclick(q, index) {
				if (q.type == 3) {
					if (this.meetinglist[index].schedule_id) {
						this.schedule_index = index
						this.schedule_id = this.meetinglist[index].schedule_id
						this.$refs.huiyi.show()
					} else {
						if (!this.istime(this.meetinglist[index].start_dtm)) {
							uni.showToast({
								title: "不能取消",
								icon: "none"
							})
						} else {
							uni.showToast({
								title: "权限不足",
								icon: "none"
							})
						}

					}
				} else if (q.type == 1) {
					if (this.meetinglist[index].schedule_id) {
						this.drawer = false
						uni.navigateTo({
							url: "./meeting?schedule_id=" + this.meetinglist[index].schedule_id
						})
					} else {
						uni.showToast({
							title: "不能编辑",
							icon: "none"
						})
					}

					// 
				} else {
					this.meetinginfo = this.meetinglist[index]
					console.log(q, index, this.meetinginfo, "强强强强")
					this.$refs.upMeetingDetail.open()

				}
			},
			handleClose(done) {
				done()
			},

			tapout() {
				this.$refs.upLogin.show()
			},
			tapposs() {
				this.$refs.showsetpoww.open()
			},
			tapinfo() {

				this.$refs.showmode.open()
			},
			showinfo() {
				this.cancel_info = !this.cancel_info
			}
		}
	}
</script>

<style>
	/deep/ .el-slider__button-wrapper {
		display: none !important;
	}

	.uni-stat__select {
		width: 100px;
		flex: none;
	}

	/deep/ .wCheckcls .el-checkbox__input {
		display: none;
	}

	/deep/ .wCheck .el-checkbox__label {
		width: 100%;
	}

	/deep/ .viewdrawer {
		background: none;
	}

	/deep/ .el-table--fit .el-table__inner-wrapper:before {
		background: #fff;
	}

	/deep/ .viewdrawer {
		margin-top: 50px;
	}



	/deep/ .sleds .el-select__wrapper {
		border-top-right-radius: 0;
		border-bottom-right-radius: 0;
	}


	/deep/ .el-popper.is-light.el-popover {
		z-index: 10 !important;
	}

	/deep/ .el-popper.is-light.el-popover.povk {
		z-index: 999 !important;
	}

	/deep/ .ppphhh {
		z-index: 1000;
	}


	.hkmk {
		height: calc(100vh - 92rpx)
	}

	.hmfsd:hover {
		color: red;
	}

	.hmfsd {
		text-align: center;
	}

	.denghlu {
		border-bottom: 2px solid #fff;
	}

	.denghlu:hover {
		cursor: pointer;
	}

	.active {
		border-bottom: 2px solid #165FFF;
		font-weight: bold;
	}

	.hover:hover {
		background: #e0eaff;
	}

	.homer:hover {
		background-color: #e8efff;
		color: #165FFF;
	}

	.dashedborder {
		border: 1px dashed #E6E6E6;
	}

	.nowrap {
		white-space: nowrap;
	}

	.xuanxia {
		transform: rotate(180deg);
	}

	.hfcenter {
		display: flex;
		align-items: center;
		padding-left: 10px;
	}
</style>